let calculator ={
    a:null,
    b:null,
    read:function(a,b){
        alert("请输入俩个值")
        let res1 = prompt("请输入第一个值",[123])
        this.a = Number(res1)
        let res2 = prompt("请输入第二个值",[123])
        this.b = Number(res2)
    },
    sum:function(){
        if(this.a!==null&&this.b!==null){
            return this.a+this.b
        }else{
            console.log("请输入俩个值");
        }
    },
    mul:function(){
        if(this.a!==null&&this.b!==null){
            return this.a*this.b
        }else{
            console.log("请输入俩个值");
        }
    },
}

calculator.read()
alert(calculator.sum())
alert(calculator.mul())

